package com.yuanqunsoft.alimigration.service.impl;

import com.yuanqunsoft.alimigration.dao.IAllUserDao;
import com.yuanqunsoft.alimigration.dao.impl.AllUserDaoImpl;
import com.yuanqunsoft.alimigration.model.AllUser;
import com.yuanqunsoft.alimigration.service.IAllUserService;

public class AllUserServiceImpl implements IAllUserService{

	private IAllUserDao allUserDao;
	@Override
	//�û����Ƿ��ظ����ظ�����true�����򷵻�false
	public boolean isNameDuplicated(String name) {
		// TODO Auto-generated method stub
		if(allUserDao.isNameExisted(name)){
			return true;
		}
		return false;
	}

	@Override
	public boolean isLoginSuccessed(String name, String psw) {
		// TODO Auto-generated method stub
		String s = allUserDao.findPswByName(name);
		if(s != null){
			if(s.equals(psw)){
				return true;
			}
		}
		return false;
	}

	@Override
	public boolean register(AllUser user) {
		// TODO Auto-generated method stub
		return this.allUserDao.addUser(user);
	}

	public IAllUserDao getAllUserDao() {
		return allUserDao;
	}

	public void setAllUserDao(IAllUserDao allUserDao) {
		this.allUserDao = allUserDao;
	}

	@Override
	public AllUser findUserByName(String name) {
		// TODO Auto-generated method stub
		return allUserDao.findUserByName(name);
	}

	
}
